package com.zhangbo.study.designpatternlearning.proxy;

import com.zhangbo.study.designpatternlearning.proxy.impl.MyRemoteImpl;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;

public class ServiceRun {

    public static void main(String[] args) {
        try {
            System.setProperty("java.rmi.server.hostname", "127.0.0.1");

            MyRemote service = new MyRemoteImpl(8080);
            Naming.rebind("RemoteHello",service);
        } catch (RemoteException e) {
            throw new RuntimeException(e);
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }

    }

}
